using Godot;
using System;

public class SignReact : TileMap
{
    Globals GameManager;
    Node dialogVars;
    public override void _Ready()
    {
        GameManager = (Globals)GetNode("/root/GameManager");
        dialogVars = GetNode("/root/Dialogue");
    }

    public void signSays()
    {
        if (Input.IsActionJustPressed("interact") && GameManager.canInteract && GameManager.playerNearSign1)
        {
            GameManager.haltPlayerMotion();
            dialogVars.Call("queue_text", TranslationServer.Translate("test_text"));
            dialogVars.Call("queue_text", TranslationServer.Translate("test_text2"));
            GD.Print("Sign showing text");
        }
    }

    // Called every frame. 'delta' is the elapsed time since the previous frame.
    public override void _Process(float delta)
    {
        signSays();
    }
}
